package com.huangtang.pc.controller;

import com.huangtang.pc.annotation.RateLimit;
import com.huangtang.pc.enums.BaseEnum;
import com.huangtang.pc.pojo.vo.enums.EnumVO;
import com.huangtang.pc.result.Result;
import com.huangtang.pc.util.EnumUtil;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @author sunjf
 * @date 2024/01/11
 */
@Api(tags = "枚举类字典控制器")
@RestController
@RequestMapping("/enum")
public class EnumController {

    @GetMapping("/BaseEnum")
    @RateLimit(limit = 10)
    public Result<List<EnumVO>> getEnumList() {
        System.out.println("接口线程" + Thread.currentThread().getName());
        return Result.success(EnumUtil.getEnumList(BaseEnum.class));
    }
}
